<template>
    <ADropdown class="s-dropdown-wrapper" v-bind="$attrs">
        <AButton>
            <span>{{ value }}</span>
            <!-- 箭头 -->
            <div class="arrow">
                <UpOutlined />
                <DownOutlined />
            </div>
        </AButton>
        <template #overlay>
            <AMenu @click="({ key }) => $emit('update:value', key)">
                <AMenuItem v-for="(value, key) in options" :key="key">{{ value }}</AMenuItem>
            </AMenu>
        </template>
    </ADropdown>
</template>

<script setup>
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue';

import './index.scss';

defineProps({
    /**
     * 值
     */
    value: [String, Number],
    /**
     * 选项
     */
    options: {
        type: Object,
        default: () => ({}),
    },
});
</script>